﻿@model S4Store.Models.FinancialReport.ZJZZModel
@{
    ViewBag.Title = "ZJZZ";
    Layout = null;
    
    S4Store.Models.Chart.Column ChartModel = new S4Store.Models.Chart.Column();
    ChartModel.Name = "各车型资金周转天数对比";
    ChartModel.YAxis = "天数";

    foreach(var report in Model.Reports){
        ChartModel.XAxis.Add(report.CarBrand.Name);       
    }
    
    S4Store.Models.Chart.ChartSeries series = new S4Store.Models.Chart.ChartSeries();
    series.Name = "目标周转天数";
    foreach (var report in Model.Reports)
    {
        series.Data.Add(report.FinancialMonthConfig.MBZZTS);
    }
    ChartModel.Serieses.Add(series);

    series = new S4Store.Models.Chart.ChartSeries();
    series.Name = "实际周转天数";
    foreach (var report in Model.Reports)
    {
        series.Data.Add(report.KCZJZZT);
    }
    ChartModel.Serieses.Add(series);
    ChartModel.IsRate = false;

    List<S4Store.Models.Chart.RedGreenIndex> RedGreenIndexs = new List<S4Store.Models.Chart.RedGreenIndex>();
    foreach (var report in Model.Reports)
    {
        S4Store.Models.Chart.RedGreenIndex index = new S4Store.Models.Chart.RedGreenIndex();
        index.Size = S4Store.Models.Chart.RedGreenIndex.IndexSize.Big;
        index.Value = report.KCZJZZTDiff.toInt();
        if( report.KCZJZZTDiff>=0){
            index.Type = S4Store.Models.Chart.RedGreenIndex.IndexType.Green;   
        }else{
            index.Type = S4Store.Models.Chart.RedGreenIndex.IndexType.Red;   
        }
        index.Title = "实际周转天数与目标周转天数的差异";
        RedGreenIndexs.Add(index);
    }
}
<div style="height:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)
<div style="position:relative; width:100%">
      
        @Html.Partial("../Chart/Column", ChartModel)
        @Html.Partial("../Chart/RedGreenIndex", RedGreenIndexs)
    
</div>
</div>


